# -*- codeing = utf-8 -*-
# @Time : 2022/2/18 13:14
# @File : config.py
# @Software : PyCharm
import os
curpath = os.path.dirname(os.path.realpath(__file__))
cfgpath = os.path.join(curpath, "setting.ini")

import configparser


conf = configparser.ConfigParser()
conf.read(cfgpath, encoding='utf-8')
items = conf.items('section0')


PROJECT_PATH = "H:\\face\\"

DATA_TMP = os.path.join(PROJECT_PATH, "data\\tmp")
DATA_TRAIN = os.path.join(PROJECT_PATH, "data\\train")
DATA_TEST = os.path.join(PROJECT_PATH, "data\\test")
DATA_MODEL = os.path.join(PROJECT_PATH, "data\\model")

DEFAULT_MODEL = "retrain.pkl"

BATCH_SIZE = int(items[0][1])
EPOCHS = int(items[1][1])
LR = float(items[2][1])

def saveData():
    conf.set('section0', "EPOCHS", str(EPOCHS))
    conf.set('section0', 'LR', str(LR))
    conf.write(open(cfgpath, "r+", encoding="utf-8"))
